<?php
/**
 * Created by PhpStorm.
 * User: wodrow
 * Date: 18-12-7
 * Time: 下午4:39
 */

namespace console\behaviors;


use common\config\Env;
use common\models\db\User;
use yii\console\Exception;
use yii\filters\AccessControl;

class Login extends AccessControl
{
    /**
     * @param \yii\base\ActionEvent $event
     * @throws Exception
     */
    public function beforeFilter($event)
    {
        // $user = User::findOne(['username' => Env::$yii2app_console_login_name]);
        // if ($user->validatePassword(Env::$yii2app_console_login_password)){
        //     \Yii::$app->user->login($user);
        // }else{
        //     throw new Exception("控制台用户错误", 201812071641);
        // }
        return parent::beforeFilter($event); // TODO: Change the autogenerated stub
    }
}